Skip to content

Conversation

@wowu
Copy link
Owner

@wowu wowu commented Nov 3, 2024

Changes:

  • Add --pre-stop-hook argument.
  • Describe in README how to setup a true zero-downtime deployment.

Notes:

  • Hook name "pre-stop" (instead of "before-stop") is inspired by watchtower hooks. This way other hooks can be named "post-stop" etc
  • I decided not to add other hooks yet - we will add them when somebody reports a need with a valid use case
  • I think it's better to implement draining with an explicitly written command in a hook, rather than a flag like --drain with the same implementation, so users can actually understand the process

Close #21, #32.

@wowu wowu mentioned this pull request Nov 3, 2024
@wowu wowu marked this pull request as ready for review November 3, 2024 14:17
@akoenig
Copy link

akoenig commented Nov 18, 2024

Thanks, @wowu. This looks fantastic! I'm looking forward to the rollout of this feature. 🚀

@wowu wowu force-pushed the request-draining branch from 2c0d4b4 to aeaae3d Compare May 21, 2025 17:53
@wowu wowu changed the title feat: true zero-downtime deployment with request draining feat: true zero-downtime deployment with container draining May 29, 2025
@wowu wowu merged commit 13bdde6 into main May 29, 2025
1 check passed
@wowu wowu deleted the request-draining branch May 29, 2025 11:12
@jippi
Copy link

jippi commented May 29, 2025

What a great timing, I literally adopted this in my project solving exactly this issue, thinking it was a feature since the start, but I somehow missed it when I did the original implementation - but no, it was just merged 15min before me going to look for something like it.

Thank you both :)

@wowu
Copy link
Owner Author

wowu commented May 29, 2025

@jippi I'm really glad it's useful since day 1 😄

Can you tell me more about your use case? How are you running docker-rollout?

@jippi
Copy link

jippi commented May 29, 2025

@wowu I'm using it on MangaBaka which is an app built with SvelteKit.

I run 3 x web containers and 3 x API containers, and want them to roll out without dropping traffic.

They are fronted by nginx-proxy that handles everything else.

Implementation wise, I raw copy+pasted the config from the docs and adjusted the sleep to my settings - worked flawlessly and extensive load testing shows 0 dropped or failed requests.

@wowu
Copy link
Owner Author

wowu commented May 29, 2025

Cool! And how do you build and deploy and new container versions? I wonder how docker rollout fits in the process, is it used as a part of a deploy script or CI/CD pipeline?

@jippi
Copy link

jippi commented May 29, 2025

I deploy to a single host via GitLab CI runners :)

@wowu
Copy link
Owner Author

wowu commented May 29, 2025

Cool, thanks for sharing 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

True zero-downtime deployment by request draining

4 participants